package audi.a4.control.gui;

import org.jfree.data.xy.XYSeries;

public class DataChannel {
	private String title;
	private XYSeries series;
	
	public DataChannel(String title) {
		this.title = title;
		series = new XYSeries(toString());
	}
	
	public String toString() {
		return title;
	}
	
	public void graphValue(double value, double t) {
		try {
			if(series != null)
				series.add(t, value);
		}catch(Exception ex) {}
	}
	
	public XYSeries getSeries() {
		return series;
	}
	
	public void clear() {
		series.clear();
	}
}
